using UnityEngine;

public class WeaponTouchCol : MonoBehaviour
{
	private WeaponAbility SCRT_WeaponAbility;

	private void Awake()
	{
		SCRT_WeaponAbility = GetComponentInParent<WeaponAbility>();
	}

	private void OnTriggerStay2D(Collider2D collision)
	{
		if (collision.CompareTag("Player") && !Player.instance.attackingNow)
		{
			Player.instance.EquipGetOrDrop("Player", false);
			Player.instance.EquipGetOrDrop("Player", true, 1, SCRT_WeaponAbility.weaponID);
			Player.instance.grabingWeaponID = SCRT_WeaponAbility.weaponID;
			Player.instance.ChangeCharacterAnimType(SCRT_WeaponAbility.kindOfWeapon);
			Player.instance.SR_Helm.sortingOrder = ((Player.instance.GetKindOfWeaponNumber() != 5) ? 2 : 1000);
			SCRT_WeaponAbility.DestroyWeapon();
			Audio.instance.sfx[28].Play();
		}
	}
}
